<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>平台余额设置</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" type="text/css" th:href="@{/js/layui/css/layui.css}" media="all">
</head>
<body class="childrenBody">


<input type="hidden" th:value="${type}" name="type"/>

<hr style="margin-top: 10px;">

<div class="layui-collapse">
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">余额</h2>
        <div class="layui-colla-content ">
            <div class="layui-form" action="" id="yue">
                <div class="layui-form-item">
                    <label class="layui-form-label" style="color: green">余额（单位元）</label>
                    <div class="layui-input-inline">
                        <input type="text" name="targetBalance" required lay-verify="number" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label" style="color: green"></label>
                    <div class="layui-input-inline">
                        <button class="layui-btn " id="type">保存</button>
                    </div>

                </div>

            </div>
        </div>
    </div>
</div>

<hr>


</div>

<script th:src="@{/js/layui/layui.js}"></script>

<!--<script type="text/javascript" src="js/newsadd.js"></script>-->

<script type="text/javascript" th:inline="javascript">
    layui.use(['table', 'form', "layer", 'layedit', 'element'], function () {

        var element = layui.element;
        var layedit = layui.layedit;
        var form = layui.form, $ = layui.jquery;


        $("#type").click(function () {
            $.ajax({
                url: [[${basePath}]] + "/balance/platform/set",
                data: {
                    type: $("input[name='type']").val(),
                    money: $("input[name='targetBalance']").val()
                },
                type: "post",
                success: function (data) {
                    if (data.success) {
                        layer.msg("设置成功", {icon: 1});
                    } else {
                        layer.msg(data.msg, {icon: 5});
                    }
                }
            });
        })
    });
</script>
</body>
</html>